            <div class="head"><h5 class="iFrames">Templates</h5></div>
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                <thead>
                    <tr>
                        <th>Order</th>
                        <th>Name</th>
                        <th>Footer Status</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    	<?php 
                    	$i = 1;
                    	
                    	foreach ($templates as $template){ 
                    	?>
		                    <tr class="gradeA">
		                    		<td>
		                    		<?php 
		                    			echo $i++;
		                    		?>
		                    		</td>
		                        	<td><?php echo $template->getName(); ?></td>
		                        	<td align="center">
		                        	<?php $path = $template->getFooterId() != null ? 'icons/notifications/accept.png' : 'icons/notifications/error.png'; ?>
		                        	<?php $alt = $template->getFooterId() != null ? 'has footer' : 'undefined footer'; ?>
		                        	<img  title="<?php echo $alt?>" src="<?php echo image_path($path)?> ">
		                        	</td>
		                        	
		                        	<td style="text-align: center">
		                        		<div style="clear:both;">
		                        				<img style="cursor:pointer" title="edit"  src="<?php echo image_path("icons/color/notebook.png")?>" onclick="$.ajax({type: 'POST', url: '<?php echo url_for('templates/show?id=' . $template->getId() )?>', script:true, cache:false, success: function(data) {  $('#template_super_container_div').html(data);} });")) />
		                        				<a href="<?php echo url_for('template_content/index?template_id=' . $template->getId() )?>" style="margin-left: 40px">
		                        					<img style="cursor:pointer" title="define content" src="<?php echo image_path("icons/color/wrench-screwdriver.png")?>" />
		                        				</a>
		                        				<a href="<?php echo url_for('comment_fields/index?template_id=' . $template->getId() )?>" style="margin-left: 40px">
		                        					<img style="cursor:pointer" title="define comment fields" src="<?php echo image_path("icons/color/balloon-ellipsis.png")?>" />
		                        				</a>		                        				
		                        				
												<img style="cursor:pointer; margin-left: 40px" title="delete template" src="<?php echo image_path("icons/color/cross.png")?>" onclick="jConfirm('Are you sure you want to delete the selected Template?', 'Confirmation Dialog', function(r){if (!r){return false} else {$.ajax({type: 'POST', url: '<?php echo url_for('templates/delete?id=' . $template->getId() )?>', script:true, cache:false, success: function(data) {  $('#template_super_container_div').html(data);} })}});")) />		   
		                        		</div>
		                        	</td>
		                        	
		                    </tr>
                        <?php }?>
                </tbody>
            </table>
       
        
        <script>
    	oTable = $('#example').dataTable({
    		"bJQueryUI": true,
    		"sPaginationType": "full_numbers",
    		"sDom": '<""f>t<"F"lp>',
    		"bDestroy": true
    	});
        </script>